const login = (usernname,password)=>{
    if (usernname.length >= 6 && password.length >= 6){
        return new Promise(resolve => {resolve('登入成功！')} );
    }else {
        return new Promise((reject) => {reject('用户名或密码错误!')})
    }
}

login('user1','13245').then(result =>{console.log(result)});
login('user123','1234567').then(result =>{console.log(result)});